package com.nobody.facepk.sns;

import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.google.gson.reflect.TypeToken;

public class Event {
	public static final Type LIST_TYPE = new TypeToken<List<Event>>() {}.getType();
	
	private Long userId;
	private EventType type;
	private Map<String, String> params = new HashMap<String,String>();
	private Long refererId;
	private long time;
	
	public Event() {}
	
	public Event(Long userId, EventType type, Long sourceId) {
		this.userId = userId;
		this.type = type;
		this.refererId = sourceId;
		this.time = System.currentTimeMillis();
	}
	
	public Long getUserId() {
		return this.userId;
	}
	public void setUserId(Long userId) {
		this.userId = userId;
	}
	public EventType getType() {
		return this.type;
	}
	public void setType(EventType eventType) {
		this.type = eventType;
	}
	public long getTime() {
		return this.time;
	}
	public void setTime(long time) {
		this.time = time;
	}
	public Map<String, String> getParams() {
		return this.params;
	}
	public void setParams(Map<String, String> params) {
		this.params = params;
	}
	public Long getRefererId() {
		return this.refererId;
	}
	public void setRefererId(Long refererId) {
		this.refererId = refererId;
	}
	public void setParam(String key, String value) {
		this.params.put(key, value);
	}
	public String getParam(String key) {
		return this.params.get(key);
	}
}
